import os


def file_exists(directory, filename):
    """
    Check if a file with the given filename exists in the specified directory.

    :param directory: The path to the directory to search in.
    :param filename: The name of the file to look for.
    :return: True if the file exists, False otherwise.
    """
    # 构建完整的文件路径
    file_path = os.path.join(directory, filename)

    # 检查文件是否存在
    return os.path.isfile(file_path)